package per.jdz.service;

import org.springframework.security.core.userdetails.UserDetailsService;

/**
 * ClassName: AuthorizeService
 * Description:
 *
 * @Author: jdz
 * @Create: 2023/4/21 - 0:50
 */
public interface AuthorizeService extends UserDetailsService {
    /**
     * 判断是注册还是重置操作，得到验证码
     * @param email
     * @param sessionId
     * @param hasAccount
     * @return
     */
    String sendValidateEmail(String email, String sessionId, boolean hasAccount);

    /**
     * 验证验证码有效性并注册
     * @param username
     * @param password
     * @param email
     * @param code
     * @param sessionId
     * @return
     */
    String validateAndRegister(String username, String password, String email, String code, String sessionId);

    /**
     * 只验证邮箱及验证码
     * @param email
     * @param code
     * @param sessionId
     * @return
     */
    String validateOnly(String email, String code, String sessionId);

    /**
     * 根据邮箱重置密码
     * @param password
     * @param email
     * @return
     */
    boolean resetPassword(String password, String email);
}
